<Project>
  <!-- This depends on the root Directory.Build.targets imported this file -->
  <UsingTask TaskName="MonoAOTCompiler" AssemblyFile="$(MonoAOTCompilerTasksAssemblyPath)" />
  <UsingTask TaskName="RuntimeConfigParserTask" AssemblyFile="$(MonoTargetsTasksAssemblyPath)" />

  <!-- For MacCatalyst, adhoc is the default. Set it here so that we don't have to specify when running local -->
  <PropertyGroup>
    <DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == '' and '$(TargetOS)' != 'maccatalyst'">-</DevTeamProvisioning>
    <DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == '' and '$(TargetOS)' == 'maccatalyst'">adhoc</DevTeamProvisioning>
  </PropertyGroup>

  <Import Project="..\..\common\LibraryBuilder.targets" />
  <Import Project="$(MSBuildThisFileDirectory)AppleBuild.targets" />

  <!-- Use local runtime pack -->
  <Target Name="UpdateRuntimePack" AfterTargets="ResolveFrameworkReferences" Condition="'$(PublishAotUsingRuntimePack)' != 'true'">
    <PropertyGroup>
      <_LocalMicrosoftNetCoreAppRuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir)</_LocalMicrosoftNetCoreAppRuntimePackDir>
    </PropertyGroup>
    <ItemGroup>
      <ResolvedRuntimePack PackageDirectory="$(_LocalMicrosoftNetCoreAppRuntimePackDir)"
                           Condition="'$(_LocalMicrosoftNetCoreAppRuntimePackDir)' != '' and
                                      '%(ResolvedRuntimePack.FrameworkName)' == 'Microsoft.NETCore.App'" />
    </ItemGroup>
    <Message Text="Used runtime pack: %(ResolvedRuntimePack.PackageDirectory)" Importance="high" />
  </Target>
</Project>
